<?php

/**
* @current commentcontent.php
* @author   LiuYang <liu_yang@haibao.com>
* @date 2016年12月14日 上午10:55:35
*/
namespace haibao\comment\data;

class CommentContent extends \haibao\comment\data\BaseMysql{
	public function __construct() {
		parent::__construct ( '\haibao\comment\model\data\CommentContent' );
		$this->setConfig( \haibao\classlibrary\www\Config::CLASSLIBRARY_CONFIG_MYSQL_HAIBAO_USER );
	}
	
	public function adoptCommentContentByCommentId($replyCommentId,$commentId){
	    $mainSql='UPDATE CommentContent SET MainCommentStates = %s WHERE CommentId = %s';
	    $this->query($mainSql,array(\haibao\comment\model\data\CommentContent::MAIN_COMMENT_STATES_ADOPT_YES,$replyCommentId));
	    
	    $sql='UPDATE CommentContent SET IsAdopt = %s WHERE CommentId = %s';
	    $this->query($sql,array(\haibao\comment\model\data\CommentContent::ISADOPT_YES,$commentId));
	}
	
	public function updateCommentContentById($commentId,$content){
	   $sql='UPDATE CommentContent SET Content = %s WHERE CommentId = %s';
	    $this->query($sql,array($content,$commentId));
	}
}